package com.kevin.spring.dto.event;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class EventTest {

	@Test
	public void TestEven() {
		
		ApplicationContext ctx = new ClassPathXmlApplicationContext(
				"applicationContext.xml");
		// 开一门课
		Course course = (Course) ctx.getBean("course");
		// 开启注册课程的服务
		StudentService service = (StudentService) ctx.getBean("studentServiceImp");
		// 注册10个学生
		for (int i = 0; i < 10; i++) {
			Student student = (Student) ctx.getBean("student");
			service.register(course, student);
		}
		
		System.out.println("end");

	}
}
